//---------------------------------------------------------------------------


#pragma hdrstop

#include "BFIOR.h"
#include "Unit1.h"


//---------------------------------------------------------------------------

#pragma package(smart_init)



BFIOR::BFIOR(TCanvas* Canvas, /*int font_size,*/ bool isInversed)
	:BFISymbol(Canvas,/*font_size,*/isInversed)
{
	this->WIDTH_COEF = 1.0;
}

int BFIOR::width()
{
	int width = BFISymbol::width();
    if (width%2 == 1) {
		width+=1;
	}
	return width;
}

void BFIOR::draw(int x, int y)
{
    X = x;
	Y = y;
	TCanvas* Canvas = this->Canvas;
	int top = this->topY();
	int bottom = this->bottomY();
	int	y_top = this->topYOperation(y);
	Canvas->MoveTo(x,y_top);
	int width = this->width();
	float width_half = width/2;
	Canvas->LineTo(x+width_half,y+bottom);
	Canvas->LineTo(x+width,y_top-1);
}
